package key_secret

import (
	"gitlab.zhijiasoft.com/paperless-group/saas-common/utils/random_string"
	"gitlab.zhijiasoft.com/paperless-group/saas-common/utils/sonyflake"
)

func GenKey() string {
	SFLKStr := sonyflake.GetStringFlake()
	RandomStr := random_string.GenRandomString(14)

	return RandomStr + SFLKStr
}

func GenSecret() string {
	SFLKStr := sonyflake.GetStringFlake()
	RandomStr := random_string.GenRandomString(128)
	return RandomStr + SFLKStr
}

//func GenSecret(key, tenantID string) string {
//	timeString := time.Now().String()
//	data := []byte(key + tenantID + timeString)
//	sha1Str := fmt.Sprintf("%x", sha1.Sum(data))
//	sha1StrAddTime := sha1Str + ".@." + timeString
//	encoded := base64.StdEncoding.EncodeToString([]byte(sha1StrAddTime))
//	return encoded
//}
